/*
 * GameConfig.cpp
 *
 *  Created on: 2013-1-23
 *      Author: heqiu
 */

#include "GameConfig.h"

string GameConfig::getKKValueStr(const char * K1, const char * K2) {
	TiXmlHandle docHandle(&m_xml);
	TiXmlHandle handle = docHandle.FirstChildElement("root").FirstChildElement(
			K1).FirstChildElement(K2);
	return handle.Element()->GetText();
}

int32_t GameConfig::getKKValueInt32(const char * K1, const char * K2) {
	TiXmlHandle docHandle(&m_xml);
	TiXmlHandle handle = docHandle.FirstChildElement("root").FirstChildElement(
			K1).FirstChildElement(K2);
	return atoi(handle.Element()->GetText());
}

void GameConfig::setKKValueStr(const char * K1, const char * K2,
		const char * pStr) {
	TiXmlHandle docHandle(&m_xml);
	TiXmlHandle handle = docHandle.FirstChildElement("root").FirstChildElement(
			K1).FirstChildElement(K2);
	handle.FirstChild().Text()->SetValue(pStr);
}
